#pragma once
#include "loadUtils.h"
/**
 * @brief Struct for storing locker data
 */
struct LockerVars{
	char lockerid[10];
	char city[30];
	char province[30];
	char location[30];
	int total;
	int used;
};
/**
 * @brief Array of LockerVars structs, allocated dynamically later on
 */
struct LockerVars *lockerdata;

/**
 * @brief keeps count of how many lockers we have, also used for memory reallocation
 */
int lockercount;

/**
 * @brief Load locker file into memory
 *
 * @param filename
 *
 * @return return code
 */
int loadLockers(char const *filename);

/**
 * @brief save lockerdata to file
 *
 * @param filename
 *
 * @return return code
 */
int writeLockers(char const *filename);

/**
 * @brief add a locker to the vector, reallocates if needed
 *
 * @param n
 */
void addLocker(struct LockerVars n);

/**
 * @brief removes a locker by index, find it yourself first ;)
 *
 * @param index
 */
void rmLocker(int index);

/**
* @brief proving that the struct was filled correctly
*
*/
void readLocker();

/**
* @brief locker assignment
*
*@param city of the client
*
*@return index of the locker
*/
int lockerAssignment(char *city);

/**
* @brief locker[i].used+1
*
*@param index
*
*/
void addUsed (int index);

/**
* @brief locker[i].used-1
*
*@param index
*
*/
void removeUsed(int index);

/**
* @brief change the city of the locker
*
*@param idlocker
*
*/
void changeCity(char *locker);

/**
* @brief delete locker
*
*@param idlocker
*
*/
void deleteLocker(char *locker);

/**
* @brief calculates a new lockerid
*
*/
void newLockerID();

/**
* @brief creates a new locker and fill the struct
*
*
*/
void newLocker();

/**
* @brief prints the lockermenu
*
*/
void menuLocker();